#include "../include/disorderArray.h"

#define N 10000

int main(){
	int a[N];
	int i,n,k;
	FILE *fp  = fopen("data/findMinKNumber.dat","rw");
	srandom(time(NULL));
	while(fscanf(fp,"%d%d",&n,&k) != EOF){
		printf("n = %d,k = %d \n",n,k);
		for(i = 0;i<n;i++){
			fscanf(fp,"%d", a+i);
		}
		printArray(a,n);
		findMinKNumber(a,n,k);
		printArray(a,k);
	}
	fclose(fp);
	return 0;

}
